//
//  SeriesSearchDetailCell.m
//  CarHome
//
//  Created by 蒋寒霄 on 14-9-24.
//  Copyright (c) 2014年 WJN_work@163.com. All rights reserved.
//

#import "SeriesSearchDetailCell.h"

@implementation SeriesSearchDetailCell
- (void)dealloc
{
    [super dealloc];
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        [self createView];
    }
    return self;
}

#pragma mark -
#pragma mark createView
- (void)createView
{
    _image= [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 4 * 30, 3 * 30)];
    _image.layer.cornerRadius = 5;
    _image.layer.borderWidth = 1;
    _image.layer.borderColor = [UIColor blackColor].CGColor;
    _image.clipsToBounds = YES;
    [self.contentView addSubview:_image];
    [_image release];
    
    _name = [[UILabel alloc] initWithFrame:CGRectMake(_image.frame.origin.x + _image.frame.size.width + 10, _image.frame.origin.y, 150, 30)];
    _name.font = [UIFont systemFontOfSize:22];
    _name.textColor = [UIColor blackColor];
    [self.contentView addSubview:_name];
    [_name release];
    
    _price = [[UILabel alloc] initWithFrame:CGRectMake(_name.frame.origin.x, _name.frame.origin.y + _name.frame.size.height + 10, 110, 20)];
    _price.font = [UIFont systemFontOfSize:15];
    _price.textColor = [UIColor redColor];
    [self.contentView addSubview:_price];
    [_price release];
    //星星层
    UILabel *back = [[UILabel alloc] initWithFrame:CGRectMake(_price.frame.origin.x, _price.frame.origin.y + _price.frame.size.height + 10, 100, 20)];
    back.backgroundColor = [UIColor lightGrayColor];
    [self.contentView addSubview:back];
    [back release];
    
    _centre = [[UILabel alloc] initWithFrame:CGRectMake(_price.frame.origin.x, _price.frame.origin.y + _price.frame.size.height + 10, 100, 20)];
    _centre.backgroundColor = [UIColor orangeColor];
    [self.contentView addSubview:_centre];
    [_centre release];
    
    UIImageView *lovegrade = [[UIImageView alloc] initWithFrame:CGRectMake(_price.frame.origin.x, _price.frame.origin.y + _price.frame.size.height + 10, 100, 20)];
    lovegrade.image = [UIImage imageNamed:@"grade_search.png"];
    [self.contentView addSubview:lovegrade];
    [lovegrade release];
    
    _grade = [[UILabel alloc] initWithFrame:CGRectMake(back.frame.origin.x + back.frame.size.width + 10, back.frame.origin.y, 70, 20)];
    _grade.font = [UIFont systemFontOfSize:18];
    _grade.textAlignment = NSTextAlignmentCenter;
    _grade.textColor = [UIColor orangeColor];
    [self.contentView addSubview:_grade];
    [_grade release];
}

- (void)awakeFromNib
{
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    // Configure the view for the selected state
}

@end
